<!DOCTYPE html>
<html lang="en" class="no-js">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="zpay个人收款助手" />
    <meta name="keywords" content="zpay个人收款助手,个人免签,收款" />
    <link rel="shortcut icon" href="img/favicon.png" />
    <title>重置密码</title>
    <link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/common.css">
</head>

<body>
    <header data-am-widget="header" class="am-header am-header-default">
        <div class="am-header-left am-header-nav">
            <h1>重置密码</h1>
        </div>
        <h1 class="am-header-title"></h1>
        <div class="am-header-right am-header-nav">
            <i class="am-header-icon am-icon-bars"></i>
        </div>
    </header>

    <div class="am-g">
        <div class="capton">重置密码</div>
        <div>
            <form class="am-form am-form-horizontal am-form-group-sm" name="letter">
                <div class="am-form-group">
                    <div class="am-u-sm-10 am-u-sm-offset-1">
                        <input type="email" id="email" class="am-form-field" required="required" placeholder="输入注册邮箱">
                    </div>
                </div>

                <div class="am-form-group">
                    <div class="am-u-sm-10 am-u-sm-offset-1">
                        <a type="submit" onclick="gogo()" class="am-btn am-btn-secondary am-btn-block">发送重置密码邮件</a>
                    </div>
                </div>
            </form>
        </div>
        <button id="TencentCaptcha" data-appid="2015154924" data-cbfn="callback" type="button" style="display:none">验证码</button>
    </div>

    <div class="push"></div>
    <footer class="footer">
            <span>©LUANGENG | ZPAY个人收款助手</span>
        </footer>
</body>

<script type="text/javascript" src="https://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="js/zpay-core-mini-0.6.1.js"></script>
<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>

<script>
    function gogo() {
        if ($('#email').val().trim().length == 0) {
            alert("请输入必填项");
            return;
        }
        $("#TencentCaptcha").trigger('click');
    }

    window.callback = function (res) {
        if (res.ret === 0) {
            AV.initialize("qGpowKJBhfJAFlsz4NtCLjlP-gzGzoHsz", "YKRMzp6TjQQ9op2YGxpYpmHg");
            AV.User.requestPasswordReset($('#email').val().trim()).then(function (success) {
                alert("重置邮件已发送,请注意查收");
                window.close();
            }, function (error) {
                alert(error);
            });
        } else {
            alert("验证失败,请重新验证");
        }
    }
</script>

</html>